//
//  SEGSubmitUserAuthViewCell.m
//  SEGUhomePropertyBaseService
//
//  Created by 揭婧雯 on 2018/12/12.
//  Copyright © 2018 刘山. All rights reserved.
//

#import "SEGSubmitUserAuthViewCell.h"

@interface SEGSubmitUserAuthViewCell()


@end

@implementation SEGSubmitUserAuthViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setSelectionStyle:UITableViewCellSelectionStyleNone];
        [self setupUI];
    }
    return self;
}

- (void)setupUI
{
    self.backgroundColor = kColor_W;
    UILabel *lable = [[UILabel alloc] init];
    lable.font = kFont_16;
    lable.tag = 1000000;
    lable.textColor = kColor_1;
    lable.text = @"房间信息";
    CGSize labelSize = [lable sizeThatFits:CGSizeMake(CGFLOAT_MAX, 20)];
    [self.contentView addSubview:lable];
    [lable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).with.offset(15);
        make.centerY.equalTo(self.contentView);
        make.width.mas_equalTo(labelSize.width);
    }];
    
    UIImage *image = [UIImage imageWithContentsOfFile:SEGPicName(@"btn_more_gray")];
    UIImageView *iconView = [[UIImageView alloc] initWithImage:image];
    [self.contentView addSubview:iconView];
    [iconView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView).with.offset(-15);
        make.centerY.equalTo(self.contentView);
        make.width.mas_equalTo(image.size.width);
    }];
    
    //选择的分类名称
    UILabel *nameLabel = [[UILabel alloc] init];
    nameLabel.font = kFont_16;
    nameLabel.textColor = kColor_C;
    nameLabel.numberOfLines = 0;
    nameLabel.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:nameLabel];
    
    [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(lable.mas_right).offset(40);
        make.right.equalTo(iconView.mas_left).offset(-10);
        make.bottom.equalTo(self.contentView).offset(-5);
        make.top.equalTo(self.contentView).offset(5);
        make.height.mas_greaterThanOrEqualTo(34);
    }];
    self.nameLabel = nameLabel;
    self.nameLabel.text = @"请选择认证房间号";
}

- (void)setHouseInfoText:(NSString *)houseInfoText
{
    _houseInfoText = houseInfoText;
    UILabel *label = [self.contentView viewWithTag:1000000];
    label.text = @"房间信息";
    if (houseInfoText.length > 0) {
        self.nameLabel.text = houseInfoText;
        self.nameLabel.textColor = kColor_1;
    }else {
        self.nameLabel.text = @"请选择认证房间号";
        self.nameLabel.textColor = kColor_C;
    }
    self.nameLabel.numberOfLines = 0;
}

- (void)setUserType:(NSString *)userType {
    _userType = userType;
    UILabel *label = [self.contentView viewWithTag:1000000];
    label.text = @"住户类型";
    if (userType.length > 0) {
        self.nameLabel.text = userType;
        self.nameLabel.textColor = kColor_1;
    }else {
        self.nameLabel.text = @"请选择您的住户类型";
        self.nameLabel.textColor = kColor_C;
    }
    self.nameLabel.numberOfLines = 1;
}

@end

